package com.css.ids.server.service.dao;

import java.util.List;

import com.css.apps.base.sysjob.model.SysJob;
import com.css.db.query.QueryCache;
import com.css.util.ListUtil;

public class IdsSysJobDao {

	@SuppressWarnings("unchecked")
	public static List<SysJob> getSysJobsByOrgIdAndJobId(String orgId, String jobId) {
	    List<String> sysJobIds = new QueryCache("select a.uuid from SysJob a where a.orgId =:orgId and a.jobId =:jobId order by a.sysId")
	    		.setParameter("orgId", orgId).setParameter("jobId", jobId).list();
	    if (ListUtil.isLstEmpty(sysJobIds))
	    	return null;
    	return QueryCache.idToObj(SysJob.class, sysJobIds);
	}
	
}
